package com.weng.starter.kafka.ack;

import com.weng.starter.kafka.ack.producer.KafkaAckSender;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController(value = "/ack-sample")
@Api(value = "消息接收确认模式", tags = {"消息接收确认模式"})
public class AckApi {

    @Autowired
    private KafkaAckSender send;

    @GetMapping("/ack/sendStr/{topic}/{max}")
    public String sendStrMax(
            @PathVariable("topic") String topic,
            @PathVariable("max") int max){
        String s = send.sendStr("测试消息",topic,max);
        return s;
    }
}
